package io;

import java.io.FileOutputStream;
import java.io.IOException;
import java.nio.charset.StandardCharsets;

public class WriteStringDemo {
    public static void main(String[] args) throws IOException {
        //向文件demo.txt中写入文本数据

                FileOutputStream fos=new FileOutputStream("demo.text");
                String line="SADADADADADADAD11";

                byte[] demo=line.getBytes(StandardCharsets.UTF_8);
                fos.write(demo);
                fos.write("笔笔比比比比比比币i哔哔哔哔哔2".getBytes(StandardCharsets.UTF_8));
                System.out.println("写出完毕！");
                fos.close();



            }
        }

   /*     FileOutputStream  fos=new FileOutputStream("demo.txt");

        String line ="beep,beep,i‘m sheep,SDADADADA,D,AD,AD,A~”;
        byte[] data=line.getBytes(StandardCharsets.UTF_8);
        fos.write(data);
        fos.write("笔笔比比比比比比币i哔哔哔哔哔2".getBytes(StandardCharsets.UTF_8));
        System.out.println("写出完毕！");
        fos.close();*/
